home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC_Samples / wcedbtst / mainfrm.cpp next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  2.0 KB  |  90 lines

  1. // MainFrm.cpp : implementation of the CMainFrame class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "wcedbtst.h"
  6. #include "MainFrm.h"
  7.  
  8. // Array tbSTDButton contains relevant buttons of bitmap IDB_STD_SMALL_COLOR
  9.  
  10. static TBBUTTON g_arCBButtons[] = {
  11.     {0,    ID_APP_ABOUT,    TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0, 0, -1}
  12. };
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CMainFrame
  16.  
  17. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  18.  
  19. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  20.     //{{AFX_MSG_MAP(CMainFrame)
  21.     ON_WM_CREATE()
  22.     //}}AFX_MSG_MAP
  23. END_MESSAGE_MAP()
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CMainFrame construction/destruction
  27.  
  28. CMainFrame::CMainFrame()
  29. {
  30. }
  31.  
  32. CMainFrame::~CMainFrame()
  33. {
  34. }
  35.  
  36. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  37. {
  38.     if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  39.         return -1;
  40.     
  41. #if(_WIN32_WCE > 200)
  42.     if(!m_wndCommandBar.Create(this) ||
  43.        !m_wndCommandBar.InsertMenuBar(IDR_MAINFRAME) ||
  44.           !m_wndCommandBar.InsertSeparator(6) ||
  45.        !m_wndCommandBar.LoadToolBar(IDR_MAINFRAME) ||
  46.        !m_wndCommandBar.AddAdornments())
  47.     {
  48.         TRACE0("Failed to create CommandBar\n");
  49.         return -1;      // fail to create
  50.     }
  51. #else // MFC for Windows CE 1.0 and 2.0
  52.     int nNumButtons = sizeof(g_arCBButtons)/sizeof(TBBUTTON);
  53.     if(!InsertButtons(g_arCBButtons, nNumButtons, IDR_MAINFRAME, 1) ||
  54.        !AddAdornments(0))
  55.     {
  56.         TRACE0("Failed to create CommandBar\n");
  57.         return -1;      // fail to create
  58.     }
  59. #endif
  60.  
  61.  
  62.     return 0;
  63. }
  64.  
  65. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  66. {
  67.     return CFrameWnd::PreCreateWindow(cs);
  68. }
  69.  
  70. /////////////////////////////////////////////////////////////////////////////
  71. // CMainFrame diagnostics
  72.  
  73. #ifdef _DEBUG
  74. void CMainFrame::AssertValid() const
  75. {
  76.     CFrameWnd::AssertValid();
  77. }
  78.  
  79. void CMainFrame::Dump(CDumpContext& dc) const
  80. {
  81.     CFrameWnd::Dump(dc);
  82. }
  83.  
  84. #endif //_DEBUG
  85.  
  86. /////////////////////////////////////////////////////////////////////////////
  87. // CMainFrame message handlers
  88.  
  89.  
  90.